<?php
	
	function errorHandler($errno, $errstr){ 
		echo "<br>Error<br>";
	}
	
	
	function test(){
		set_error_handler("errorHandler");
		1/0;
	}
	
	1/0;
	test();
	1/0;
	
	
	function catch_fatal_error()
{
  // Getting Last Error
   $last_error =  error_get_last();

    // Check if Last error is of type FATAL
    if(isset($last_error['type']) && $last_error['type']==E_ERROR)
    {
    // Fatal Error Occurs
    // Do whatever you want for FATAL Errors
     }

}
register_shutdown_function('catch_fatal_error');